// 第三
$.ajax({
    type: "post",
    async: true, //异步执行
    url: "sy/nydsj/tryjz",
    dataType: "json", //返回数据形式为json
    success:function(json){
        var jsonarray = $.parseJSON(json);
        var myChart = echarts.init(document.getElementById('main3'));
        option = {

            // backgroundColor: '#00265f',
            tooltip: {
                trigger: 'axis',
                axisPointer: {
                    type: 'shadow'
                }
            },
            legend: {
                data: ['实际值'/*, '标准值' */],
                textStyle:{color:'#fff'}
            },
            grid: {

                x: '0%',
                x2: '5%',

                y: '10%',
                y2: '50%',
                containLabel: true
            },
            xAxis: [{
                type: 'value',
                boundaryGap: [0, 0.01],
                axisLabel: {
                    formatter: '{value}',
                    textStyle: {
                        color: '#fff'
                    }
                }

            }],
            yAxis: [{
                type: 'category',
                data: [],
                axisLabel: {
                    show: true,
                    textStyle: {
                        color: '#fff'
                    }
                }
            }],
            series: [ {
                name: '实际值',
                type: 'bar',
                data: []
            }/*,
        {
            name: '标准值',
            type: 'bar',
            data: []
        }*/]
        };
        $.each(jsonarray,function(index,item){
            for(var i=0;i<option.yAxis.length;i++){
                option.yAxis[i].data.push(item.massifName)
                option.series[i].data.push(item.organic);
            }
        });



        myChart.setOption(option);
    },
    error:function(errorMsg){alert("请求数据失败");}
});